﻿namespace Okazuki.BehaviorSupport.Design.Commons
{
    using System;
    using System.Collections.Generic;
    using System.Windows;
    using System.Linq;

    /// <summary>
    /// BehaviorSelectWindow.xaml の相互作用ロジック
    /// </summary>
    public partial class BehaviorSelectWindow : Window
    {
        public BehaviorSelectWindow(IEnumerable<Type> behaviors)
        {
            InitializeComponent();
            this.listBoxBehaviors.ItemsSource = behaviors;
        }

        public Type SelectedBehaviorType
        {
            get
            {
                return this.listBoxBehaviors.SelectedItem as Type;
            }
        }

        private void buttonOk_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }

        private void buttonCancel_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}
